package br.edu.uepb.nutes.entities;

import java.util.ArrayList;
import java.util.List;

import br.edu.uepb.nutes.entities.enums.dados.endereco.Pais;
import lombok.Data;

@Data
public class Endereco {
	
	private	String cep;
	private String pais; // ISO 3166-1 https://phinvads.cdc.gov/vads/ViewCodeSystem.action?id=1.0.3166.1#
	private String estado; //State is required if the country is US. 
						  //if country is something other than US, the state MAY be present but MAY be bound to different vocabularies.
	private String cidade;
	private List<String> telefones;
	
	public Endereco() {
		super();
		this.cep = "";
		this.pais = "";
		this.estado = "";
		this.cidade = "";
		this.telefones = new ArrayList<String>();
	}

	public String getEstado() {
		if(this.estado == null) {
			this.estado = "";
		}
		return this.estado;
		
	}
	
	
	public String getCep() {
		if(this.cep == null) {
			cep = "";
		}
		return cep;
	}
	
	public String getPais() {
		
		if(pais.equals("")) {
			return Pais.BRASIL.code();
		}
		
		return pais.substring(0, 3).toUpperCase();
	}

	

	

}
